var should = require('should');
var _ = require('lodash');
var secretSweepHandler = require('../../../app/servers/copy/handler/secretSweepHandler');
var config = require('../../config');
var configUtil = require('../../../app/util/configUtil');
var analyze = require('kc-analyze');

suite('初始化', function () {
    test('analyze', function (done) {
        var analyze_config = configUtil.load('analyze');
        var game_config = configUtil.load('game');
        analyze.initialize({
            host: analyze_config.host,
            server_id: game_config.server_id
        });
        done();
    });
});

suite('测试secretSweepHandler', function () {
    suite('use', function () {
        test('初始化', function (done) {
            var analyze_config = configUtil.load('analyze');
            var game_config = configUtil.load('game');
            analyze.initialize({
                host: analyze_config.host,
                server_id: game_config.server_id
            });
            done();
        });

        test('副本扫荡', function (done) {
            var msg = {
                copy_id: config.copy_id,
                num: config.num
            };
            var session = {};
            session.uid = config.role_id;
            var secret_sweep_handler = new secretSweepHandler();
            secret_sweep_handler.sweep(msg, session, function (err, res) {
                console.log('res:', res);
                done();
            });
        });
    });

});
